package cn.wolfcode.wolf2w.business.controller.admin;

import cn.wolfcode.wolf2w.business.repository.UserinfoEsRepository;
import cn.wolfcode.wolf2w.business.service.IDestinationEsService;
import cn.wolfcode.wolf2w.business.service.INoteEsService;
import cn.wolfcode.wolf2w.business.service.IStrategyEsService;
import cn.wolfcode.wolf2w.business.service.IUserinfoEsService;
import cn.wolfcode.wolf2w.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SearchAdminController {

    @Autowired
    private IStrategyEsService strategyEsService;
    @Autowired
    private INoteEsService noteEsService;
    @Autowired
    private IDestinationEsService destinationEsService;
    @Autowired
    private IUserinfoEsService userinfoEsService;


    @GetMapping("/dataInit")
    public R<?> dataInit(){
        strategyEsService.initStrategyEs();
        noteEsService.initNoteEs();
        destinationEsService.initDestinationEs();
        userinfoEsService.initUserinfoEs();
        return R.ok("ES数据同步成功");
    }
}
